<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<script type="text/javascript">
function daochu(zlid)
	{
		if(confirm("确定要导出报表?")){
			window.location="export.action?zlid="+zlid
			return true;
		}
		else{
			return false;
		}
	}
</script>

		<s:head theme="ajax" />

		<title>专利奖励信息</title>
		<link rel="stylesheet" type="text/css" href="../css/counter.css">
		<link rel="stylesheet" type="text/css" href="../css/css.css">
		<%
			request.setAttribute("decorator", "none");
			response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1
			response.setHeader("Pragma", "no-cache"); //HTTP 1.0
			response.setDateHeader("Expires", 0); //prevents caching at the proxy server
		%>

		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		<script type="text/javascript" src="../javascript/common.js"></script>
		<SCRIPT LANGUAGE="JavaScript">
var checkflag = "false";
function check(field) {


if (checkflag == "false") {

for (i = 0; i < field.length; i++) {
field[i].checked = true;


}

checkflag = "true";
return "取消全部";


}else 
{

for (i = 0; i < field.length; i++) {
field[i].checked = false; }

checkflag = "false";
return "全部选取"; 


}
}
function oncheckbox(obj){
var arr=document.getElementsByName("flag");

var c=document.getElementsByName("shbz");
for(var i=0;i<c.length;i++){
if(c[i].checked==false){
for(var i=0;i<arr.length;i++){
arr[i].disabled=false;}
return false;
}

}
for(var i=0;i<arr.length;i++){
arr[i].disabled=true;}
}
function oncheckboxsubmit(){
var c=document.getElementsByName("shbz");


var flag=0
for(var i=0;i<c.length;i++){
if(c[i].checked==true){
flag=1;
break;


}

}

if(flag==0){

alert("请选中复选框！");
return false;
}

}

</script>


	</head>

	<body>
		<form action="modifyShbz.action" name=form1 method="post"
			onsubmit="return oncheckboxsubmit();">
			<TABLE cellSpacing="0" cellPadding="0" width="100%" align="center"
				border="0">
				<TBODY>
					<TR>
						<TD>
							<IMG src="../images/manage/arron1.gif">
							<FONT class="font_lv">${qxkwTitle} </FONT>
						</TD>
						<td></td>
					</TR>
				</TBODY>
			</TABLE>



			<TABLE cellSpacing="1" cellPadding="1" width="100%" align="center"
				border="0">
				<tr>
					<td>
					<!-- 
						<input class="btn1" type="button" name="query" value="查询"
							onclick="toSearch('search_div');">
                    -->
					</td>
					<td align="right">
						${pageStr}
					</td>
				</tr>





			</table>

			<TABLE cellSpacing="1" cellPadding="1" width="100%" border="0">

				<TR>
					<TD class=line>
						<table height="100%" cellSpacing=1 cellPadding=2 width="100%"
							bgColor=#CCCCCC border=0>
							<tr>
								<td align="center" background="../images/manage/title_bg.jpg"
									class="font_12_B_w">
									序号
									<!-- 
									<input name="aa" type="checkbox" title='全选/取消'
										onclick="check(this.form.shbz)">
									<br />
                                     -->
								</td>
								<td align="center" background="../images/manage/title_bg.jpg"
									class="font_12_B_w">
									申报人
								</td>


								<td align="center" background="../images/manage/title_bg.jpg"
									class="font_12_B_w">
									项目名称
								</td>
								<td align="center" background="../images/manage/title_bg.jpg"
									class="font_12_B_w">
									专利号
								</td>
								<td align="center" background="../images/manage/title_bg.jpg"
									class="font_12_B_w">
									联系人
								</td>
								<td background="../images/manage/title_bg.jpg"
									class="font_12_B_w" align="center">
									联系电话
								</td>
								<!-- 
								<td align="center" background="../images/manage/title_bg.jpg"
									class="font_12_B_w">
									注销状态
								</td>
                                 -->
								<td align="center" background="../images/manage/title_bg.jpg"
									class="font_12_B_w">
									操作
								</td>

							</tr>

							<s:iterator value="basicInfoList" id="bil" status="b">
								<tr bgColor=#FFFFFF>
									<td align="center" width="5%">
									<!-- 
										<input type=checkbox name=shbz value="${zlid}">
										 -->
										 ${pageRow+b.count}
									</td>
									<td width="13%" align="center">
										<s:property value="sbr" />

									</td>


									<td width="24%">
										<s:property value="name" />
									</td>
									<td width="17%">
										<s:property value="zlid2" />
									</td>

									<td width="8%">
										<s:property value="lxr" />
									</td>
									<td width="9%" align="center">
										<s:property value="yddh" />
									</td>
									<!-- 
									<td width="6%" align="center">


										<s:if test="${zxbz=='1'}">
											<div id=${zlid } style="CURSOR:hand"
												onmouseover="this.style.color='#ff0000'"
												onmouseout="this.style.color='#000000'"
												onclick="alert_updateZxbz('${zlid}','${zxbz}',this)">
												<font color="blue">已注销</font>
											</div>
										</s:if>
										<s:else>
											<div id=${zlid } style="CURSOR:hand"
												onmouseover="this.style.color='#ff0000'"
												onmouseout="this.style.color='#000000'"
												onclick="alert_updateZxbz('${zlid}','${zxbz}',this)">
												<font color="blue">未注销</font>
											</div>
										</s:else>

									</td>
                                     -->
									<td width="24%" align="center">
										<s:url id="zlUrl" namespace="/admin" action="viewZl">
											<s:param name="zlid" value="zlid"></s:param>
										</s:url>
										<a href="viewZl.action?zlid=${zlid}" target="_blank">详细信息</a>|
										<a onclick="daochu('${zlid}');" href="#">导出报表</a>|
										<a href="viewTjyj.action?zlid=${zlid}">推荐意见</a>|
										<s:set name="mqxkw" value="#session.logininfo.qxkw" />


									</td>

								</tr>
							</s:iterator>
						</table>
					</td>
				</tr>
			</table>
		</form>
		<s:set name="qxkw" value="#session.logininfo.qxkw"></s:set>
		<form name="queryModel"
			action="basicInfoQuery.action?basicinfo$qxkw=${qxkw}" method="post">



			<DIV id="search_div"
				style="BORDER-RIGHT: #cee6ff 1px outset; BORDER-TOP: #cee6ff 1px outset; LEFT: 15%;  OVERFLOW: hidden; VISIBILITY: hidden; BORDER-LEFT: #cee6ff 1px outset; WIDTH: 500px; BORDER-BOTTOM: #cee6ff 1px outset; POSITION: absolute; TOP: 5%; HEIGHT: 150px; BACKGROUND-COLOR: #eeeeee">
				<table width="100%" cellpadding="0" cellspacing="0"
					bgcolor="#ffffff">
					<tr>
						<td>

							<TABLE height="100%" cellSpacing=1 cellPadding=2 width="100%"
								bgColor=#ffffff border=0>
								<TBODY>
									<TR class=bg height=23>
										<td width="4%" background="../images/manage/title_bg.jpg"
											class="font_12_B_w">
											<IMG src="../images/manage/arron1.gif">
											发明专利信息查询
										</TD>
									</TR>
								</TBODY>
							</TABLE>
							<TABLE height="100%" cellSpacing=1 cellPadding=2 width="100%"
								bgColor=#ffffff border=0>
								<TR>
									<th bgcolor="#EAEEEE" class="font__12_grey">
										专利号
									</Th>
									<td bgcolor="#EAEEEE" class="font__12_grey">
										<input type=text name="bm_basicinfo$zlid2" Class="id_kuang">
									</TD>
									<th bgcolor="#EAEEEE" class="font__12_grey">
										发明人
									</Th>
									<td bgcolor="#EAEEEE" class="font__12_grey">
										<input name="bm_basicinfo$fmr" Class="id_kuang">
									</TD>
								</TR>
								<TR>
									<th bgcolor="#EAEEEE" class="font__12_grey">
										专利名称
									</Th>
									<td bgcolor="#EAEEEE" class="font__12_grey">
										<input name="bm_basicinfo$name" Class="id_kuang">
									</TD>
									<th bgcolor="#EAEEEE" class="font__12_grey">
										专利类别
									</Th>
									<td bgcolor="#EAEEEE" class="font__12_grey">
										<input name="bm_basicinfo$zltype" Class="id_kuang">
									</TD>
								</TR>
								<TR>
									<th bgcolor="#EAEEEE" class="font__12_grey">
										申请起始日期
									</Th>
									<td bgcolor="#EAEEEE" class="font__12_grey">
										<input name="bm_basicinfo$sqrq_begin_date" Class="id_kuang"
											readonly
											onclick="javascript:insertDate_manage(this);">
									</TD>
									<th bgcolor="#EAEEEE" class="font__12_grey">
										申请终止日期
									</Th>
									<td bgcolor="#EAEEEE" class="font__12_grey">
										<input name="bm_basicinfo$sqrq_end_date" readonly
											Class="id_kuang"
											onclick="javascript:insertDate_manage(this);">
									</TD>
								</TR>
								<!-- 
								<TR>
									<th bgcolor="#EAEEEE" class="font__12_grey">
										允许修改专利信息
									</Th>
									<td bgcolor="#EAEEEE" class="font__12_grey">
										<input name="bm_basicinfo$shbz" type="radio" value="1" />
									</TD>
									<th bgcolor="#EAEEEE" class="font__12_grey">
										禁止修改专利信息
									</Th>
									<td bgcolor="#EAEEEE" class="font__12_grey">
										<input name="bm_basicinfo$shbz" type="radio" value="0" />
									</TD>
								</TR>
                               -->
							</TABLE>

							<table width="100%" border="0" cellpadding="0" cellspacing="0"
								bgcolor="#EAEEEE">
								<tr>
									<td>
										<CENTER>
											<input type="submit" name="tj" value="提交">

											&nbsp;&nbsp;
											<input type="button" onclick="toSearch('search_div')"
												name="qx" value="取消">

										</CENTER>
									</td>
								</tr>
							</table>

						</td>
					</tr>
				</table>
			</DIV>
		</form>
		<s:url id="smdUrl" namespace="/admin" action="changeZxbz" />

	</body>
	<script type="text/javascript">
	 function alert_delBasicinfo(zlid)
	{
		if(confirm("确实要删除该专利信息吗？")){
			window.location="delBasicInfo.action?zlid="+zlid
			return true;
		}
		else{
			return false;
		}
	}
    function alert_updateZxbz(zlid,zxbz,obj)
	{
		if(confirm("确实要改变注销标志吗？")){
			updateZxbz(zlid,zxbz,obj);
			return true;
		}
		else{
			return false;
		}
	}
	
    function updateZxbz(zlid,zxbz,obj){
    dojo.require("dojo.rpc.*");
    
    //create service object(proxy) using SMD (generated by the json result)
    var service = new dojo.rpc.JsonService("${smdUrl}");
   // var name=document.getElementById('name').value;
       //parameter
       var zl="0";
      if(obj.innerHTML=="已注销"){
        zl="1";
      
      }else {
         zl="0";
      }
    var bean= {zlid:zlid,zxbz:zl};
    
    //execute remote method
   
    var defered = service.doChangeZxbz(bean);
    
    //function called when remote method returns
   
    
    var callback = function(bean) {
        if(bean.zxbz=="1"){
        alert("该专利已经注销！");
        
        obj.innerHTML="已注销";
        }else {
        alert("该专利已设为未注销状态!");
        obj.innerHTML="未注销";
        }
      
        
    };
   
 

    //attach callback to defered object
    defered.addCallback(callback);
    }
</script>
</html>
